With improvement of people's quality of life, more and more users utilize humidifiers for moisturizing. Generally, the humidifier is provided with a water tank, a water trough, a buoy, and an atomizing sheet. When a water level in the water trough reaches a predefined height, the buoy controls a component to block a water inlet between the water tank and the water trough. When the water level in the water trough does not reach the predefined height, the buoy controls the component to open the water inlet between the water tank and the water trough, thereby water in the water tank flows into the water trough. The atomizing sheet is used for atomizing the water in the water trough and discharging the atomized water.